﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DBBase;

namespace Business
{
    public partial class PhotoAll : Form
    {
        public PhotoAll()
        {
            InitializeComponent();
        }

        private void com_name_SelectedIndexChanged(object sender, EventArgs e)
        {
            string sql = "";
            Query quer = new Query();
            if (com_name.Text.Contains("高拍"))
            {
                sql = string.Format(@"select * from PhotoAll where zp_codebit='GP'");
            }
            else if (com_name.Text.Contains("手机"))
            {
                 sql = string.Format(@"select * from PhotoAll where zp_codebit='APP'");
            }
            else if (com_name.Text.Contains("GW"))
            {
                sql = string.Format(@"select * from PhotoAll where zp_codebit='APP'");
            }
            DataTable dt = quer.GetTable(sql);
            if (dt.Rows.Count>0)
            {
                lv.Clear();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ListViewItem lt = new ListViewItem(string.Format("{0}", dt.Rows[i]["zp_id"].ToString().Trim()));
                    lt.SubItems.Add(dt.Rows[i]["zp_xh"].ToString().Trim());
                    lt.SubItems.Add(dt.Rows[i]["zp_name"].ToString().Trim());
                    lt.SubItems.Add(dt.Rows[i]["zp_code"].ToString().Trim());
                    this.lv.Items.Add(lt);
                    
                }
            }
        }
    }
}
